import request from '../utils/request.js'
import { getToken } from '../utils/auth.js'

export function getUserInfoByUserPartToken() {
  return request({
    url: '/ui/partId',
    method: 'get',
    params: {
      token: getToken()
    }
  })
}

export function getUserInfoByToken() {
  return request({
    url: '/ui/',
    method: 'get'
  })
}

export function getUserInfoById(userId) {
  return request({
    url: '/ui/',
    method: 'get',
    params: {
      userId: userId
    }
  })
}

export function conditionSearchUserInfo(condition) {
  return request({
    url: 'ui/condition',
    method: 'get',
    params: condition
  })
}

export function updateUserInfo(userBirthday,userClassName,userEmail,userId,userLevel,userName,userOrigin,userPartName,userPhone,userSex,userUpdateTime) {
  return request({
    url: '/ui/',
    method: 'put',
    params: {
      userBirthday:userBirthday,
      userClassName:userClassName,
      userEmail:userEmail,
      userId:userId,
      userLevel:userLevel,
      userName:userName,
      userOrigin:userOrigin,
      userPartName:userPartName,
      userPhone:userPhone,
      userSex:userSex,
      userUpdateTime:userUpdateTime 
    }
  })
}
